import {createEditor, createToolbar} from 'wang-editor'

export default {
    data() {
        return {
            editor: undefined,
            editorConfig: {placeholder: '请输入内容'},
            toolbarConfig: {
                excludeKeys: ['fullScreen']
            }
        }
    },
    mounted() {
        this.editor = createEditor({
            selector: '#editor-container',
            config: this.editorConfig,
            mode: 'simple' // 或 default'simple'
        })
        toolbar = createToolbar({
            editor:this.editor,
            selector: '#toolbar-container',
            config: this.toolbarConfig,
            mode: 'simple' // 或 'simple'
        })
    },
    template: `
        <div class="wang-ed">
            <div id="toolbar-container"></div>
            <div id="editor-container"></div>
        </div>
    `
}